package zy05;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;

public class zy8 {
	public static void main(String[] args) {
		ArrayList<String> poker = new ArrayList<String>();
		String[] colors={"♥","♠","♣","♦"}; 
		String[] numbers={"2","A","K","Q","J","10","9","8","7","6","5","4","3"};
		int[] userP = new int[9];
		ArrayList<String> LookPoker = new ArrayList<>();
		HashSet<Integer> index = new HashSet<>();
		poker.add(0,"大王");
		poker.add(1,"小王");
		for(String number:numbers){
			for(String color:colors){
				poker.add(color+number);
			}
		}
		System.out.println(poker);
		HashMap<Integer,String> map =new HashMap<>();
		for(int i=0;i<poker.size();i++){
			String str = poker.get(i);
			map.put(i, str);
		}
		System.out.println(map);
		Random r = new Random();
		while(true){
			int num = r.nextInt(54);
			index.add(num);
			if(index.size()==9){
				break;
			}
		}
		System.out.println(index);
		int j=0;
			for(int c:index){
				userP[j++]=c;
			}
		Arrays.sort(userP);
		for(int num :userP){
			System.out.print(num+" ");
			String str = map.get(num);
			LookPoker.add(str);
			}
		System.out.println();
		System.out.println(LookPoker);
		}
}

